package com.example.tourism.controller;

import com.example.tourism.service.impl.RabbitMQSenderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rabbitMQ")
public class RabbitController {

    @Autowired
    private RabbitMQSenderService rabbitMQSenderService;

    @GetMapping("/send")
    public String sendMessage(@RequestParam String message) {
        rabbitMQSenderService.send(message);
        return "Message sent to RabbitMQ!";
    }
}
